<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="script/jquery-1.7.2.js"></script>
<script type="text/javascript">
	$(function(){
		//给按钮绑定单击事件
		$("#btnId").click(function(){
			//设置url
			var url = "GetUsersWithAjax";
			//发送Ajax请求
			$.post(url,function(data){
				var str = "<tr><th>Id</th><th>Username</th><th>Password</th><th>Email</th></tr>";
				for(var i= 0 ;i <data.length;i++){
					var user = data[i];
					str+="<tr align='center'><td>"
		                 +user.id+
		                 "</td><td>"
		                 +user.username+
		                 "</td><td>"
		                 +user.password+
		                 "</td><td>"
		                 +user.email+
		                 "</td></tr>"	
				}        

				$("#tb").html(str);
			},"json");
		});
		
	});
</script>
</head>
<body>
	<button id="btnId">发送Ajax请求获取所有的员工</button>
	<table id="tb" border="1px"  align="center" width="60%" cellspacing="0px" >	
	</table>
</body>
</html>